package top.hcode.hoj.pojo.dto;

import lombok.Data;
import org.nutz.lang.Strings;

/**
 * @author orangej
 * @since 2024/12/18
 */
@Data
public class BasePageDTO {
    private int currentPage = 1;
    private int limit = 10;

    /**
     * 排序字段
     */
    protected String sort;

    /**
     * 排序方式：升序：asc，降序：desc
     */
    protected String order = "asc";

    public boolean isSortValid() {
        return Strings.isNotBlank(sort) && Strings.isNotBlank(order);
    }
}
